This repository has been archived by the owner on Feb 26, 2024. It is now read-only.
feat(error): fix #975, can config how to load blacklist zone stack frames #1045
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
fix #975.
current
zone-error
provide several functionality.handle
class MyError extends Error
,new MyError() instanceof Error
will reportfalse
issue.remove
zone.js internal stack trace frames
.add
zone
information to eachzone frame
.The No2 and No3. feature will slow down the
new Error()
performance,So the motivation of this PR is to provide a flag to let user be able to disable No2 and No3.
The flag is
__Zone_Error_BlacklistedStackFrames_policy
. And the available options is:default: this is the default one, if you load
zone.js/dist/zone-error
withoutsetting the flag,
default
will be used, andBlackListStackFrames
will be availablewhen
new Error()
, you can get aerror.stack
which iszone stack free
. But thiswill slow down
new Error()
a little bit.disable: this will disable
BlackListZoneStackFrame
feature, and if you loadzone.js/dist/zone-error
, you will only get awrapped Error
which can handleError inherit
issue.lazy: this is a feature to let you be able to get
BlackListZoneStackFrame
feature,but not impact performance. But as a trade off, you can't get the
zone free stack frames
by accesserror.stack
. You can only get it by accesserror.zoneAwareStack
.